# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=jwt-hack
pkgver=v2.4.0.r17.g3e0d8cc
pkgrel=1
pkgdesc='A tool for hacking / security testing to JWT.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-webapp' 'blackarch-cracker')
url='https://github.com/hahwul/jwt-hack'
license=('MIT')
depends=('glibc')
makedepends=('git' 'cargo')
source=("git+https://github.com/hahwul/$pkgname.git")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $pkgname

  cargo build --release
}

package() {
  cd $pkgname

  install -Dm 755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md SECURITY.md

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

